package gcu.module.rbac.dao.mapper;

import gcu.module.rbac.daomain.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by haol on 2016/9/18.
 */
@Repository
public interface UserMapper {

      /*check loginname and password is ok AND check loginname is unique*/
      User queryUserByName(@Param("username") String username);

      /*增加用户*/
      void addUser(@Param("user") User user);


      /*删除用户*/
      void deleteUser(@Param("id") Integer id);

      /*更新用户*/
      void updateUser(@Param("user") User user);

      void updatePwd(@Param("username")String username,@Param("password")String password);

      User queryUserById(@Param("id") Integer id);

      List<User> query(@Param("user") User user, @Param("skip") int skip, @Param("size") int size);

      List<User> queryAll();

      long count(@Param("user") User user);

      void updateTime(@Param("updateTime") String updateTime, @Param("userName") String username);

}
